﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ExportToVis.CApExportToVisUtilities
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System.Collections.ObjectModel;
using System.Reflection;
using System.Resources;
using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands.ExportToVis;

public class CApExportToVisUtilities
{
  public static ResourceManager GetResourceManager()
  {
    return new ResourceManager("DnProcessSimulateCommands.ExportToVis.Resources.ExportToVisStringTable", Assembly.GetCallingAssembly());
  }

  public static bool IsGraphicViewerEmpty()
  {
    TxObjectList txObjectList = new TxObjectList();
    foreach (ITxDisplayableObject allDescendant in (Collection<ITxObject>) TxApplication.ActiveDocument.PhysicalRoot.GetAllDescendants((ITxTypeFilter) new TxTypeFilter(typeof (ITxDisplayableObject))))
    {
      if (allDescendant.Visibility == null || allDescendant.Visibility == 1)
        ((Collection<ITxObject>) txObjectList).Add((ITxObject) allDescendant);
    }
    return ((Collection<ITxObject>) txObjectList).Count == 0;
  }

  public static TxObjectList GetAllDisplayedObjects()
  {
    TxObjectList allDescendants = TxApplication.ActiveDocument.PhysicalRoot.GetAllDescendants((ITxTypeFilter) new TxTypeFilter(typeof (ITxDisplayableObject)));
    TxObjectList displayedObjects = new TxObjectList();
    foreach (ITxObject itxObject in (Collection<ITxObject>) allDescendants)
    {
      if ((itxObject as ITxDisplayableObject).Visibility == null || (itxObject as ITxDisplayableObject).Visibility == 1)
        ((Collection<ITxObject>) displayedObjects).Add(itxObject);
    }
    return displayedObjects;
  }
}
